<?php
namespace app\index\controller;

use think\Db;

class Test extends \think\Controller
{
    public function index()
    {
       /*$result = Db::execute('insert into think_data ( name ,status) values ( "thinkphp2",1)');
		dump($result);*/

		//$result = Db::table('think_data')->insert(['name' => '洪丽霞爱唐剑', 'status' => 1]);
		$a = Db::name('data')->insert(['name' => '唐剑','status' => 1]);
		var_dump($a);	
    }

    public function select()
    {
    	$result = DB::query('select * from think_data where id <= 5');

    	dump($result);
    }
  // 获取用户数据列表并输出
    public function muban()
    {	
    	

    	$list = $result = DB::query('select * from think_data ');;
        $this->assign('list', $list);
        $this->assign('count', count($list));
        return $this->fetch('muban');
    	
    }
   
   
}
